<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>tab--只读--审查信息--分配专家--审查意见</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <style>
        body{
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding-right:60px;
        }
        .layui-table th, .layui-table td {
            text-align: center;
        }
    </style>
</head>
<body>
<p style="font-size: 14px;font-weight: bold;">
    <span>流程当前办理阶段:</span>
    <span class="stage" style="color: #0000FF"></span>
</p>
<div style="padding-left: 30px">
<p style="font-size: 14px;margin: 20px 0px;">
    <span style="font-weight: bold;">专家列表</span>
</p>
<form class="layui-form" action="" lay-filter="example">
    <div class="layui-form-item">
        <label class="layui-form-label">技术负责人</label>
        <div class="layui-input-block">
            <input id="jsfzrId" class="layui-disabled layui-input" disabled value="" >
        </div>
    </div>
    <table class="layui-table" lay-filter="example2">
        <colgroup>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
        <tr class="">
            <th>专业</th>
            <th>审查人</th>
            <th>审核人</th>
        </tr>
        </thead>
        <tbody class="tbodyHtml" id="expertList">
        <tr class="formTr">
            <td class="specialtyName">
                勘察专业
                <input type="hidden" name="specialtyId" value="kczyyt">
            </td>
            <td>
                <select name="exExpertId" lay-verify="required" class="realName" disabled>
                    <option value="0"></option>
                </select>
            </td>
            <td>
                <select name="auExpertId" lay-verify="required" class="realName" disabled>
                    <option value="0"></option>
                </select>
            </td>
        </tr>
        <tr class="formTr">
            <td class="specialtyName">
                结构专业
                <input type="hidden" name="specialtyId" value="jzzy">
            </td>
            <td>
                <select name="exExpertId" lay-verify="required" class="realName" disabled>
                    <option value="0"></option>
                </select>
            </td>
            <td>
                <select name="auExpertId" lay-verify="required" class="realName" disabled>
                    <option value="0"></option>
                </select>
            </td>
        </tr>
        </tbody>
    </table>
</form>
    <p style="font-size: 14px;margin: 20px 0px;">
        <span style="font-weight: bold;">政策性审查报告</span>
    </p>
    <form class="layui-form" action="" lay-filter="example1">
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col width="200">
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>审查人</th>
                <th>审查时间</th>
                <th>审查报告</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <input id="checkUser" name="checkUser" class="layui-input layui-disabled"
                           style="text-align: center;border: none;" disabled value="">
                </td>
                <td>
                    <input id="checkTime" name="checkTime" class="layui-input layui-disabled"
                           style="text-align: center;border: none;" disabled value="">
                </td>
                <td class="see">查看</td>
            </tr>
            </tbody>
        </table>
    </form>
<p style="font-size: 14px;margin-bottom: 20px">
    <span style="font-weight: bold;">技术性审查情况</span>
</p>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>
</div>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="opinion">查看</a>
</script>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    var $;
    var listData = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'form', 'table', 'matchDict'], function () {
        $ = layui.jquery;
        var configure = layui.configure;
        var form = layui.form;
        var table = layui.table;
        var matchDict = layui.matchDict;
        var sessionFun = layui.sessionFun;
        configureCom = layui.configureCom;
        listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        $('.stage').html(listData.taskDefName);
        var cols = [[
            {
                field: 'specialtyId', title: '专业名称', templet: function (d) {

                    return '<input type="hidden" value="'+ d.specialtyId+'" class="zhuanye"><p>' + matchDict.name(d.specialtyId, configure.ALL_SPE) + '</p>'
                }
            },
            {
                field: 'checkTimes', title: '审查轮数'
            },
            {
                field: 'expertScResult', title: '审查人', templet: function (d) {
                    return '<p>' +d.expertScName +'</p><p style="color: #ccc;">' + matchDict.name(d.expertScResult, configure.RESULT) + '</p><p>'+(d.expertScResultTime || '-') +'</p>';

                }
            },
            {
                field: 'expertShResult', title: '审核人', templet: function (d) {
                    return '<p>' +d.expertShName +'</p><p style="color: #ccc;">' + matchDict.name(d.expertShResult, configure.RESULT) + '</p><p>'+(d.expertShResultTime || '-') +'</p>';
                }
            },
            {
                field: 'leaderResult', title: '技术负责人',width: 200,    templet: function (d) {
                    return '<p>' +d.leaderName +'</p><p style="color: #ccc;">' + matchDict.name(d.leaderResult, configure.RESULT) + '</p><p>'+(d.leaderResultTime || '-') +'</p>';
                }
            },
            { title: '审查意见', toolbar: '#barDemo', width: 150}
        ]];
        //渲染表格
        configureCom.postDataAjax(configure.LEADER_SPEC_RESULT_LIST_HTTP, {decId: listData.decId }).then(function (res) {
            var dataArr = res.prjSpecResultList;
            configureCom.tableRenderUserDefined({}, cols, dataArr, 'dataList',400);
            //configureCom.tableMergeFun({}, cols, dataArr, 'dataList',400);
        });

        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            sessionFun.set(configure.SESSION_PROJECT_LIST_DATA, data);
            if (obj.event === 'opinion') {//查看意见
                var content  = configureCom.nocache(configure.EXAMINE_EXAMINATION_OPINION_HTML);//查看意见
                if (configureCom.orgTypeFun(configure.KC_CODE)|| configureCom.orgTypeFun(configure.SJ_CODE)) {//如果当前登录账号是勘察设计院
                    content  = configureCom.nocache(configure.EXAMINE_RESPONDING_COMMENTS_HTML);//回复意见
                }
                top.layer.open({
                    type: 2,
                    title:'本专业意见',
                    area: configureCom.Psize1,
                    content:content,
                    success: function (layero, index) {
                        //top.layer.full(index);
                    }
                });
            }
        });
        //渲染专家下拉框
        configureCom.postDataAjax(configure.EXAMINE_PRICE_TASK_GET_EXPERT_HTTP, {decId: listData.decId}).then(function (res) {
            $('#jsfzrId').val(res.allotExpertList.jsfzrName);
            var nextAll = res.allotExpertList.allotExpertList;
            if(nextAll.length>0){
                var html = '';
                $(nextAll).each(function (index, item) {
                    html += '<tr class="formTr">\n' +
                        '            <td class="specialtyName">' + item.specialtyName + '</td>\n' +
                        '            <input name="specialtyId" type="hidden" value="' + item.specialtyId + '">' +
                        '            <td><input value="'+ item.exExpertName +'" class="layui-disabled layui-input" disabled></td>\n' +
                        '            <td><input value="'+ item.auExpertName +'" class="layui-disabled layui-input" disabled></td>\n' +
                        '        </tr>';
                });
                $('#expertList').html(html);
                var listAll = {
                    jsfzrId: res.allotExpertList.jsfzrId
                };
                form.render('select');
                form.val('example', listAll)
            }

        });

        /**
         * 专家option
         * list:专家列表
         * targetVal:默认值,不传则为空
         * idKey:专家id的key,不传默认为userId
         * nameKey:专家name的key,不传默认为realName
         * **/
        function expertOptionFun(list, targetVal) {
            var html = '<option>请选择</option>';
            $.each(list, function (index, item) {
                html += '<option value="' + item.userId + '" ' + (targetVal == item.userId ? 'selected' : '') + '>' + item.realName + '</option>';
            });
            return html;
        }
        //政策性审查信息
        configureCom.postDataAjax(configure.EXAMINE_SHOW_POLICY_REPORT_HTTP, {decId: listData.decId}).then(function (res) {
            pastData = {
                checkUser: res.prjPolicyReport.checkUser,//审查人
                checkTime: res.prjPolicyReport.checkTime//审查时间
            };

            form.val('example1', pastData)

        });
        $('.see').on('click', function (obj) {
            configureCom.openPdfContract(configure.CONTRACT_SIGN_ZHENGCE + '?decId=' + listData.decId);
        });
    });


</script>
</body>
</html>